import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { xzqhTreeSelectListApi } from '/@/api/wyf/xzqh/select';
//经营查询
export const operateSearchFormSchema: FormSchema[] = [
  // {
  //   field: 'tjfw',
  //   label: '所属区域',
  //   component: 'ApiTreeSelect',
  //   componentProps: {
  //     api: xzqhTreeSelectListApi,
  //     params: {},
  //     resultField: 'result',
  //     multiple: false,
  //   },
  // },
  {
    field: 'tjfw',
    label: '所属区域',
    //component: 'ApiTreeSelect',
    component: 'JCascader',
    componentProps: {
      api: xzqhTreeSelectListApi,
      params: {},
      //resultField: 'title',
      // fieldNames: {
      //   label: 'title',
      //   value: 'value',
      // },
      // multiple: true,
      changeOnSelect: true,
    },
  },
];
//经营表格列
export const operateColumns: BasicColumn[] = [
  {
    title: '所属区域',
    dataIndex: 'namepath',
    width: 170,
    align: 'left',
    resizable: true,
  },
  {
    title: '房源总数',
    dataIndex: 'zs',
    width: 130,
    resizable: true,
  },
  {
    title: '个人经营房源数量',
    dataIndex: 'gr',
    width: 140,
    resizable: true,
  },
  {
    title: '单位经营房源数量',
    dataIndex: 'dw',
    width: 140,
    resizable: true,
  },
  {
    title: '正常经营房源数量',
    dataIndex: 'zc',
    width: 140,
    resizable: true,
  },
  {
    title: '歇业房源数量',
    dataIndex: 'xy',
    width: 120,
    resizable: true,
  },
  {
    title: '停业房源数量',
    dataIndex: 'ty',
    width: 120,
    resizable: true,
  },
];

//房源入住查询
export const propertyCheckInSearchFormSchema: FormSchema[] = [
  // {
  //   field: 'tjfw',
  //   label: '所属区域',
  //   component: 'ApiTreeSelect',
  //   componentProps: {
  //     api: xzqhTreeSelectListApi,
  //     params: {},
  //     resultField: 'result',
  //     multiple: false,
  //   },
  // },
  {
    field: 'tjfw',
    label: '所属区域',
    //component: 'ApiTreeSelect',
    component: 'JCascader',
    componentProps: {
      api: xzqhTreeSelectListApi,
      params: {},
      //resultField: 'title',
      // fieldNames: {
      //   label: 'title',
      //   value: 'value',
      // },
      // multiple: true,
      changeOnSelect: true,
    },
  },
];
//房源入住表格列
export const propertyCheckInColumns: BasicColumn[] = [
  {
    title: '所属区域',
    dataIndex: 'namepath',
    width: 170,
    align: 'left',
    resizable: true,
  },
  {
    title: '正常经营房源总数',
    dataIndex: 'zs',
    width: 130,
    resizable: true,
  },
  {
    title: '在住房源数量',
    dataIndex: 'zz',
    width: 140,
    resizable: true,
  },
  {
    title: '入住率',
    dataIndex: 'rzl',
    width: 140,
    resizable: true,
    customRender: ({ text, record }) => {
      return text + '%';
    },
  },
];

//房源审核查询
export const examineSearchFormSchema: FormSchema[] = [
  // {
  //   field: 'tjfw',
  //   label: '所属区域',
  //   component: 'ApiTreeSelect',
  //   componentProps: {
  //     api: xzqhTreeSelectListApi,
  //     params: {},
  //     resultField: 'result',
  //     multiple: false,
  //   },
  // },
  {
    field: 'tjfw',
    label: '所属区域',
    //component: 'ApiTreeSelect',
    component: 'JCascader',
    componentProps: {
      api: xzqhTreeSelectListApi,
      params: {},
      //resultField: 'title',
      // fieldNames: {
      //   label: 'title',
      //   value: 'value',
      // },
      // multiple: true,
      changeOnSelect: true,
    },
  },
];
//房源审核表格列
export const examineColumns: BasicColumn[] = [
  {
    title: '所属区域',
    dataIndex: 'namepath',
    width: 170,
    align: 'left',
    resizable: true,
  },
  {
    title: '房源总数',
    dataIndex: 'zs',
    width: 130,
    resizable: true,
  },

  {
    title: '审核通过房源数量',
    dataIndex: 'tg',
    width: 140,
    resizable: true,
  },
  {
    title: '审核不通过房源数量',
    dataIndex: 'btg',
    width: 140,
    resizable: true,
  },
  {
    title: '待审核房源数量',
    dataIndex: 'dsh',
    width: 130,
    resizable: true,
  },
];

//住客来源查询
export const tenantSourceSearchFormSchema: FormSchema[] = [
  // {
  //   field: 'tjfw',
  //   label: '所属区域',
  //   component: 'ApiTreeSelect',
  //   componentProps: {
  //     api: xzqhTreeSelectListApi,
  //     params: {},
  //     resultField: 'result',
  //     multiple: false,
  //   },
  // },
  {
    field: 'tjfw',
    label: '所属区域',
    //component: 'ApiTreeSelect',
    component: 'JCascader',
    componentProps: {
      api: xzqhTreeSelectListApi,
      params: {},
      //resultField: 'title',
      // fieldNames: {
      //   label: 'title',
      //   value: 'value',
      // },
      // multiple: true,
      changeOnSelect: true,
    },
  },
  {
    label: '入住时间',
    field: 'sjfw',
    component: 'RangeDate',
    componentProps: {
      //日期格式化
      format: 'YYYY/MM/DD',
      //范围文本描述用集合
    },
    colProps: { span: 6 },
  },
];
//住客来源表格列
export const tenantSourceColumns: BasicColumn[] = [
  {
    title: '所属区域',
    dataIndex: 'name',
    width: 170,
    align: 'left',
    resizable: true,
  },
  {
    title: '住客所属省份',
    dataIndex: 'namepath',
    width: 200,
    resizable: true,
  },
  {
    title: '住客人数',
    dataIndex: 'zs',
    width: 140,
    resizable: true,
  },
];

//住客入住查询
export const tenantCheckInSearchFormSchema: FormSchema[] = [
  {
    field: 'tjfw',
    label: '所属区域',
    component: 'ApiTreeSelect',
    componentProps: {
      api: xzqhTreeSelectListApi,
      params: {},
      resultField: 'result',
      multiple: false,
    },
  },
  {
    label: '入住时间',
    field: 'sjfw',
    component: 'RangeDate',
    componentProps: {
      //日期格式化
      format: 'YYYY/MM/DD',
      //范围文本描述用集合
    },
    colProps: { span: 6 },
  },
];
//住客入住表格列
export const tenantCheckInColumns: BasicColumn[] = [
  {
    title: '所属区域',
    dataIndex: 'name',
    width: 170,
    align: 'left',
    resizable: true,
  },
  {
    title: '男性住客人数（比例）',
    dataIndex: 'man',
    width: 140,
    resizable: true,
  },
  {
    title: '女性住客人数（比例）',
    dataIndex: 'woman',
    width: 140,
    resizable: true,
  },
  {
    title: '小于18岁',
    dataIndex: 'child',
    width: 120,
    resizable: true,
  },
  {
    title: '18～35岁',
    dataIndex: 'young',
    width: 120,
    resizable: true,
  },
  {
    title: '35～60岁',
    dataIndex: 'middle',
    width: 120,
    resizable: true,
  },
  {
    title: '60岁以上',
    dataIndex: 'old',
    width: 120,
    resizable: true,
  },
];
